function HandleDirectorySimple(gui, operator, now, options) {
  this._gui = gui;
  this._operator = operator;
  this._now = now;
  this._options = options;
  
  this._dirId = (options && options.d) ? options.d : 0;
  this._items= (options && options.items) ? options.items : [];
  this._callfunc = (parent.document._func) ? parent.document._func[0] : null;

  if (options) {
    this._createElements();
  }
};

HandleDirectorySimple.prototype._createElements = function() { 
  
  tr = this._gui.content.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.width = '400px';
  td.style.height = '150px';
  td.style.textAlign = 'center';
  td.style.verticalAlign = 'middle';
  td.appendChild(DOMUtils.getLoadingImage());
  
  this._loadData();
};

HandleDirectorySimple.prototype._loadData = function() {
  this._files = null;
  this._retrieveFiles();
};

HandleDirectorySimple.prototype._verifyData = function() {
  if (this._files) {
    this._updateElements();
  }
};

HandleDirectorySimple.prototype._retrieveFiles = function() {
  var _self = this;
  new RequestUtils()._read('file', null, 'd.parentDirId=\'' + this._dirId + '\' AND d.customerTrackId=\'' + this._operator.trackId + '\'', null, null, 'd.name', null, function(result, params) { _self._files = result.data;
                                                                                                                                                                                                  _self._verifyData.call(_self);
                                                                                                                                                                                                }, null);
};

HandleDirectorySimple.prototype._updateElements = function() {
  var _self = this;
  DOMUtils.removeChildElements(this._gui.content);

  var files = NPFileUtils.diff(this._files, this._items);
  for (var i = 0, il = files.length; i < il; i++) {
    var file = files[i];
    if (file.dirId) {
      if (this._gui.content.rows.length == 0)  {
        td = this._gui.content.insertRow(-1).insertCell(-1);
      } else if (this._gui.content.rows[this._gui.content.rows.length - 1].cells.length < 5) {
        td = this._gui.content.rows[this._gui.content.rows.length - 1].insertCell(-1);
      } else {
        td = this._gui.content.insertRow(-1).insertCell(-1);
      }
      td.style.width = '50px';
      td.style.textAlign = 'left';
      td.style.verticalAlign = 'top';
      var func = function(dirId) { _self._callfunc(dirId);
                                 };
      new ModuleViewFile(document, td, 79, 75, this._operator, this._now, { callbackFunc: func, item: file} );
    }
  }
};

